<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>虚拟 DOM</title>
    <script src="./js/react.development.js"></script>
    <script src="./js/react-dom.development.js"></script>
  </head>
  <body>
    <div id="root"></div>
    <script>
      // React 元素.  虚拟 DOM   => 本身就是一个对象
      // React 会根据虚拟 DOM 创建真实 DOM 插入到文档中.
      // 作用: 高效更新
      let vdom = React.createElement('h1', {title:'标题'}, '我是一个 H1 标题元素哦~~~');

      //输出虚拟 DOM
      console.log(vdom);
      //输出真实 DOM
      console.dir(document.querySelector('#root'));
    </script>
  </body>
</html>
